﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace GeoPal
{
    /// <summary>
    /// Class that represents the user settings
    /// </summary>
    [Serializable()]
    public class Settings
    {
        /// <summary>
        /// Constructor of the Settings class (initializes default values)
        /// </summary>
        public Settings() {
            userName = "";
            userPass = "";
            serverurl = "http://192.168.1.121/geopal/";
            googleApiKey = "ABQIAAAA6Niw-YBYygCHqgUMmojuvxQnjAmGUfS1bPTFXb2qcMj5PKWuUxQdLU7HN27ZMkB2yxsdkhQre3_omg";
            updateDistance = 0;
            updateInterval = 30;
            requestInterval = 30;
            googleMapType = "mobile";
            isLogged = false;
        }
        /// <summary>
        /// Username
        /// </summary>
        public string UserName {
            get { return userName; }
            set { userName = value; }
        }
        /// <summary>
        /// User password
        /// </summary>
        public string UserPass
        {
            get { return userPass; }
            set { userPass = value; }
        }
        /// <summary>
        /// Location of the server (URL)
        /// </summary>
        public string ServerUrl
        {
            get { return serverurl; }
            set { serverurl = value; }
        }
        /// <summary>
        /// Serial port to GPS receiver
        /// </summary>
        public string Port
        {
            get { return port; }
            set { port = value; }
        }
        /// <summary>
        /// Baud rate of the used serial port
        /// </summary>
        public uint Baud
        {
            get { return baud; }
            set { baud = value; }
        }
        /// <summary>
        /// Time interval between two position updates
        /// </summary>
        public int UpdateInterval
        {
            get { return updateInterval; }
            set { updateInterval = value; }
        }
        /// <summary>
        /// Distance between two position updates
        /// </summary>
        public int UpdateDistance
        {
            get { return updateDistance; }
            set { updateDistance = value; }            
        }
        /// <summary>
        /// Time interval between two contact data requests
        /// </summary>
        public int RequestInterval
        {
            get { return requestInterval; }
            set { requestInterval = value; }
        }
        /// <summary>
        /// Google API key for maps
        /// </summary>
        public string GoogleApiKey
        {
            get { return googleApiKey; }
            set { googleApiKey = value; }
        }
        /// <summary>
        /// Google map type (mobile, roadmap, terrain, hybrid, etc.)
        /// </summary>
        public string GoogleMapType
        {
            get { return googleMapType; }
            set { googleMapType = value; }
        }
        /// <summary>
        /// Is the position has to be logged on the server?
        /// </summary>
        public bool IsLogged
        {
            get { return isLogged; }
            set { isLogged = value; }
        }
        /// <summary>
        /// Is the GPS reveiver should be disabled after the update?
        /// </summary>
        public bool IsEnergySave
        {
            get { return isEnergySave; }
            set { isEnergySave = value; }
        }
        /// <summary>
        /// Username on Twitter
        /// </summary>
        public string TwitterName
        {
            get { return twitterName; }
            set { twitterName = value; }
        }
        /// <summary>
        /// Password on Twitter
        /// </summary>
        public string TwitterPass
        {
            get { return twitterPass; }
            set { twitterPass = value; }
        }
        private string userName;
        private string userPass;
        private string serverurl;
        private string port;
        private uint baud;
        private int updateInterval;
        private int updateDistance;
        private int requestInterval;
        private string googleApiKey;
        private string googleMapType;
        private bool isLogged;
        private bool isEnergySave;
        private string twitterName;
        private string twitterPass;
    }
}